<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:73:"/www/wwwroot/mamingwang.cn/yzf/application/admin/view/user/bankindex.html";i:1556589173;s:70:"/www/wwwroot/mamingwang.cn/yzf/application/admin/view/common/head.html";i:1556002984;}*/ ?>
<!DOCTYPE html>
<html>
  
  <head>
    <meta charset="UTF-8">
    <title>聚财国际</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="/public/static/css/font.css"> 
	<link href="/favicon.ico" type="image/x-icon" rel="shortcut icon" /> 
    <link rel="stylesheet" href="/public/static/css/xadmin.css">
    <link href="/public/static/lib/layui/css/layui.css" rel="stylesheet">
    <script type="text/javascript" src="/public/static/js/jquery.min.js"></script>
    <script type="text/javascript" src="/public/static/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="/public/static/js/xadmin.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script type="text/css">
      #fff{
        border: red solid 1px;
      }
    </script>
  </head>
  
<body>
<div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="">首页</a>
        <a href="">演示</a>
        <a>
          <cite>银行卡管理</cite></a>
      </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="<?php echo url('admin/user/bankindex'); ?>" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>
<div class="x-body">
    <div class="layui-row">
        <form class="layui-form layui-col-md12 x-so">
            <div class="layui-input-inline">
                <select name="cateid">
                    <option value="">搜索关键词</option>
                    <option value="u_phone">账号</option>
                    <option value="u_name">姓名</option>
                    <option value="b_bank">所属银行</option>
                    <option value="b_card">银行卡号</option>
                </select>
            </div>
            <input type="text" name="Key"  placeholder="请输入关键词" autocomplete="off" class="layui-input">
            <span>添加时间</span><input class="layui-input" placeholder="开始日" name="datemin" id="start">至
            <input class="layui-input" placeholder="截止日" name="datemax" id="end">
            <input type="submit" name="sub" class="layui-btn" value="开始搜索" lay-submit="" lay-filter="sreach">
        </form>
    </div>
    <form class="layui-form" action="" method="post">
    <table class="layui-table">
        <thead>
        <tr style="text-align: center">
            <th style="text-align: center">NO</th>
            <th style="text-align: center">账号</th>
            <th style="text-align: center">姓名</th>
            <th style="text-align: center">所属银行</th>
            <th style="text-align: center">银行卡号</th>
            <th style="text-align: center">添加时间</th>
            <th style="text-align: center">锁定状态</th>
        </tr>
        </thead>
        <tbody>
        <?php if(is_array($rs) || $rs instanceof \think\Collection || $rs instanceof \think\Paginator): $i = 0; $__LIST__ = $rs;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$rs): $mod = ($i % 2 );++$i;?>
        <tr style="text-align: center">
            <td><?php echo $key+1; ?></td>
            <td><?php echo $rs['u_phone']; ?></td>
            <td><?php echo $rs['u_name']; ?></td>
            <td><?php echo $rs['b_bank']; ?></td>
            <td><?php echo $rs['b_card']; ?></td>
            <td><?php echo $rs['b_createtime']; ?></td>
            <?php if(\think\Session::get('admin_uid')==1): ?>
            <td><input type="checkbox" <?php if ($rs['b_state'] ==0): ?>  checked="" <?php endif; ?> name="status[]" lay-skin="switch" lay-filter="switchSuodoing" lay-text="开启|关闭" value="<?php echo $rs['bid']; ?>"/></td>
            <?php else: ?>
            <td><?php if($rs['b_state']==1): ?><button class="layui-btn layui-btn-radius layui-btn-warm">正常</button><?php else: ?><button class="layui-btn layui-btn-radius layui-btn-danger">锁定</button><?php endif; ?></td>
            <?php endif; ?>
        </tr>
        <?php endforeach; endif; else: echo "" ;endif; ?>
        </tbody>
    </table>
    </table>
    <div class="page">
        <div>
        <?php echo $page; ?>
        </div>
    </div>
    </form>
</div>
<script>
    layui.use(['laydate','form'], function() {
        var laydate = layui.laydate;
        var form = layui.form;
        //执行一个laydate实例
        //执行一个laydate实例
        laydate.render({
            elem: '#start' //指定元素
        });

        //执行一个laydate实例
        laydate.render({
            elem: '#end' //指定元素
        });
        form.on('switch(switchSuodoing)', function (data) {
            var id = data.value;
            //alert(111);
            $.ajax({
                url: "<?php echo url('admin/user/bankstate'); ?>",
                type: "post",
                dataType: "JSON",
                data: {bid: id},
                success: function (res) {
                    if (res == 1) {
                        layer.msg('操作成功！');
                        //alert(11);
                        //location.reload();
                        return false;
                    } else {
                        layer.msg('操作失败！');
                        /*setTimeout(function () {
                            location.reload();
                        }, 1000);*/
                        return false;
                    }
                }
            });
        });

    })

</script>

</body>

</html>